package com.sh.enums;

/**
 * @author luotao
 */

public enum BizCodeEnum {

    SUCCESS(200, "操作成功"),
    CREATED(201, "对象创建成功"),
    ACCEPTED(202, "请求已经被接受"),
    NO_CONTENT(204, "操作已经执行成功，但是没有返回数据"),

    MOVED_PERM(301, "资源已被移除"),
    SEE_OTHER(303, "重定向"),
    NOT_MODIFIED(304, "资源没有被修改"),

    BAD_REQUEST(400, "参数列表错误（缺少，格式不匹配）"),
    UNAUTHORIZED(401, "未授权"),
    PERMISSION_FAIL(402, "访问受限，权限不足"),
    FORBIDDEN(403, "访问受限，授权信息未被信任"),
    NOT_FOUND(404, "资源/服务未找到"),
    BAD_METHOD(405, "不允许的http方法"),
    PARAM_ERROR(406, "参数校验失败"),
    CONFLICT(409, "账号已在其他设备登录"),
    UNSUPPORTED_TYPE(415, "不支持的数据，媒体类型"),

    ERROR(500, "服务异常"),
    NON_UNIQUE_FAIL(510,"唯一性校验失败"),
    NOT_IMPLEMENTED(501, "接口未实现"),

    WARN(601, "系统警告消息"),
    DATA_NOT_EXISTED(2001, "数据不存在"),
    EXIST_RUNNING_TASK_ERROR(3001, "有任务正在运行");



    private Integer code;
    private String message;

    BizCodeEnum(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }

}
